package com.zhiyin.seal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiyin.seal.entity.CompanyAuthEntity;
import com.zhiyin.seal.entity.CompanyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface CompanyDao extends BaseMapper<CompanyEntity> {

    CompanyEntity selectCompanyById(@Param("id") Long id);

    CompanyEntity selectCompanyByNameSingle(@Param("name") String name);

    CompanyEntity getLastCompanyByCreateUser(@Param("id") Long createUser);

    List<CompanyEntity> selectAllCompanyList(@Param("keywords") String keywords);

    List<CompanyEntity> selectCompanyListByIds(@Param("idList") List<Long> idList);

    Integer selectCompanyByName(@Param("name") String name,@Param("userId") Long userId);

    Integer insertCompany(@Param("companyEntity")CompanyEntity companyEntity);

    CompanyEntity getUserDefaultCompany(@Param("userId")Long userId);

    Integer joinCompany(@Param("companyId") Long companyId,@Param("userId") Long userId);

    Integer joinCompany2(@Param("companyId") Long companyId,@Param("userId") Long userId,@Param("nickName") String nickName);

    Integer transferCompany(@Param("companyId") Long companyId,@Param("userId") Long userId);

    Integer deleteCompany(@Param("companyId") Long companyId);

    CompanyAuthEntity selectCompanyAuth(@Param("name") String name);

    Integer insertCompanyAuth(@Param("auth") CompanyAuthEntity auth);

    Integer updateCompanyAuthStatus(@Param("companyId") Long companyId);

    Integer updateChangeCompany(@Param("companyId") Long companyId,@Param("name") String name);

    String selectTrade(@Param("domain") String domain);

    List<String> selectRegion(@Param("districtCode") String districtCode);

    Integer selectCompanyCount();
}
